package com.linkwedo.saas.project;

import java.sql.Timestamp;

import java.util.Date;
import java.util.List;
import javax.servlet.http.HttpServletRequest;
import org.apache.struts2.interceptor.ServletRequestAware;

import com.linkwedo.saas.domain.Project;
import com.linkwedo.saas.domain.ProjectReview;
import com.linkwedo.saas.util.DateUtil;
import com.opensymphony.xwork2.ActionSupport;


public class DeleteProjectReviewAction extends ActionSupport implements ServletRequestAware{
	public static long getSerialversionuid() {
		return serialVersionUID;
	}
	private static final long serialVersionUID = 8190003683775267839L;
	private ProjectReviewService projectReviewService;
	
	private Integer projectReviewId;

	private javax.servlet.http.HttpServletRequest request;
	public void setServletRequest(HttpServletRequest request) {
		// TODO Auto-generated method stub
		this.request=request;
	}
	
	private List<ProjectReview> list;
	public List<ProjectReview> getList() {
		return list;
	}

	public void setList(List<ProjectReview> list) {
		this.list = list;
	}	
	public String execute() throws Exception {
		String idStr=request.getParameter("projectReviewId");
		if(null == idStr || idStr.equalsIgnoreCase("")){
			return ERROR;
		}
		projectReviewId = Integer.parseInt(idStr);
		getProjectReviewService().deleteById(projectReviewId);//.disableById(pid)
		//getProjectReviewService().disableById(projectReviewid);
		list=getProjectReviewService().findAll();
		return "ok";
	}


	public Integer getProjectReviewId() {
		return projectReviewId;
	}

	public void setProjectReviewId(Integer projectReviewId) {
		this.projectReviewId = projectReviewId;
	}

	public ProjectReviewService getProjectReviewService() {
		return projectReviewService;
	}

	public void setProjectReviewService(ProjectReviewService projectReviewService) {
		this.projectReviewService = projectReviewService;
	}
	
	}
